﻿<!--#include file="const.inc"-->

<%
	dim rs,sql,i

select case v
case "0"
we0="<br/>"
hr="------------<br/>"
%>
<card title="友情链接"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
we1="</div>"
%>
<title>友情链接</title>
</head>
<body>
<%

End Select




                if sid="Null" then
		%><%=we%><%=zi%>欢迎你<%=zi0%><a href="/login.asp?sid=<%=sidd%>&amp;url=/link/index.asp?id=<%=id%>">注册/登陆</a><%=we0%><%
		else
		qingtian.info
		end if
Response.Write(""&sou&"<b><a href=""/index.asp?sid="&sidd&""">首页</a>&gt;<a href=""add.asp?sid="&sidd&""">申请友链</a>&gt;友链</b>"&we0&""&hr&"")

			Set Rs = Server.CreateObject("Adodb.Recordset")
			%><%=dao%>-=活跃站点=-<%=we0%><%=we%><%
			Sql = "select top 8 [id],[main],[show] from [qingtian_link_list] order by [totime] desc"
			Rs.Open Sql,conn,1,1
			if not (rs.bof and rs.eof)  then
			For i=1 to rs.RecordCount
				if rs("show")=1 then
				%><a href="view.asp?id=<%=rs("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("main"))%></a><%
				else
				%><%=qingtian.utf8(rs("main"))%><%
				end if
				if i=rs.RecordCount then
				else
				%>|<%
				end if
			Rs.MoveNext
			next
                        else
                        %>
                        暂无活跃站点
                        <%
			end if
			Rs.close
			%><%=we0%><%=dao%>-=推荐站点=-<%=we0%><%=we%><%
				Randomize
			Sql = "select top 8 [id],[main],[show] from [qingtian_link_list] order by rnd( -(id+" & Rnd() & ")) desc"
			Rs.Open Sql,conn,1,1
			if not (rs.bof and rs.eof)  then
			For i=1 to rs.RecordCount
				if rs("show")=1 then
				%><a href="view.asp?id=<%=rs("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("main"))%></a><%
				else
				%><%=qingtian.utf8(rs("main"))%><%
				end if
				if i=rs.RecordCount then
				else
				%>|<%
				end if
			Rs.MoveNext
			next
                        else
                        %>
                        暂无推荐站点
                        <%
			end if
			Rs.close
                        set rs=nothing
			%><%=we0%><%=dao%>-=精选分类=-<%=we0%><%=we%><%
                        Set Rs = Server.CreateObject("Adodb.Recordset")
			Sql = "select [id],[name],[br] from [qingtian_link_class] order by pid asc"
			Rs.Open Sql,conn,1,1
			if not (rs.bof and rs.eof)  then
			For i=1 to rs.RecordCount
				%>〖<a href="list.asp?classid=<%=rs("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a>〗<%
                linkkt(rs("id"))
        Response.Write "<br/>"
			Rs.MoveNext
			next
                        else
        Response.Write "本类暂无数据<br/>"
			end if
			Rs.close
%><%=we1%><%=dao%>-=最新添加=-<%=we0%><%=we%><%
			Sql = "select top 8 [id],[main],[show] from [qingtian_link_list] order by id desc"
			Rs.Open Sql,conn,1,1
			if not (rs.bof and rs.eof)  then
			For i=1 to rs.RecordCount
				if rs("show")=1 then
				%><a href="view.asp?id=<%=rs("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("main"))%></a><%
				else
				%><%=qingtian.utf8(rs("main"))%><%
				end if
				if i=rs.RecordCount then
				%><%=we0%><%
				else
				%>|<%
				end if
			Rs.MoveNext
			next
                        else
                        %>
                         暂无最新站点<br/>
                        <%
			end if
			Rs.close
			set rs=nothing
%>
<%=hr%>
<%=sou%><a href='add.asp?sid=<%=sidd%>'>友链自助申请</a><%=we0%>
 
		<%
end Function
Function linkkt(str)
dim rst,sqlt,j
Set Rst = Server.CreateObject("Adodb.Recordset")
		Sqlt = "select top 8 id,main from qingtian_link_list where [show]=1 and classid="&str&" order by [totime] desc"
		Rst.Open Sqlt,conn,1,1
		if not (rst.bof and rst.eof) then
		For j=1 to rst.RecordCount
		If rst.Eof Then
			exit For
		End If
			%><a href="view.asp?id=<%=rst("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rst("main"))%></a><%
			Rst.MoveNext
			next
                        else
        Response.Write "本类暂无数据"
			end if
			Rst.close
			set rst=nothing
end Function
%>
